﻿<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
            xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

<xsd:annotation>
  <xsd:appinfo>
    <sql:relationship name="CustAdd"
        parent="Customers"
        parent-key="CustomerID"
        child="Customers"
        child-key="CustomerID" />
  </xsd:appinfo>
</xsd:annotation>

<xsd:element name="Root" sql:is-constant="1">
  <xsd:complexType>
  <xsd:sequence>
  <xsd:element name="Customers">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="CompanyName" type="xsd:string" /> 
        <xsd:element name="ContactName" type="xsd:string" /> 
        <xsd:element name="ContactTitle" type="xsd:string" /> 
        <xsd:element name="Phone" type="xsd:string" /> 
        <xsd:element name="Fax" type="xsd:string" /> 
 	<xsd:element ref="FullAddress"/>
      </xsd:sequence>
      <xsd:attribute name="CustomerID" type="xsd:integer" /> 
    </xsd:complexType>
  </xsd:element>
  </xsd:sequence>
  </xsd:complexType>
</xsd:element>

  <xsd:element name="FullAddress" sql:relation="Customers" sql:relationship="CustAdd" sql:key-fields="CustomerID" >
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Address" type="xsd:string" /> 
        <xsd:element name="City" type="xsd:string" /> 
        <xsd:element name="Region" type="xsd:string" /> 
        <xsd:element name="PostalCode" type="xsd:string" /> 
        <xsd:element name="Country" type="xsd:string" /> 
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>

